<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2. 使用set实现数组去重</title>
</head>
<body>
    <script>
        let arr = [123,321,123,520,520,128,127,128];
        let se = [...new Set(arr)]; //通过剩余操作符把集合转换为数组
        // let se = Array.from(new Set(arr));
        console.log(se);
    </script>
</body>
</html>